package com.mtao.utils;

import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;

public class DateUtils {
    public static Date getDate(){
        ZoneId zone = ZoneId.systemDefault(); // 获取系统默认时区
        ZonedDateTime zonedDateTime = ZonedDateTime.now(zone); // 获取当前时间
        Date date = Date.from(zonedDateTime.toInstant()); // 将 ZonedDateTime 转换为 Date
        return  date;
    }
}
